package com.cy.utils;

import java.util.Date;
import java.util.HashMap;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;

public class TempGetPoint {

	public static JSONObject selectPoint(String userId, String mtype) {
		String appid = "clmp01";
		String content = "{\"userid\": " + userId + "}";
		String timestamp = String.valueOf(new Date().getTime());
		String secret = "46a3f3a30976ca3177b13014d78f9931";
		String sign = "appid" + appid + "mtype" + mtype + "timestamp" + timestamp + secret;
		sign = Digests.getMd5(sign);

		HashMap<String, String[]> params = new HashMap<>();
		params.put("appid", new String[] { appid });
		params.put("mtype", new String[] { mtype });
		params.put("sign", new String[] { sign });
		params.put("timestamp", new String[] { timestamp });
		params.put("content", new String[] { content });
		
		String retMsg = SimpleHttpUtils.sendRequest(PropertyUtil.getGrosseValue(PropertyUtil.KERNEL, "shopIf"), "POST", "UTF-8", params);
		return JSON.parseObject(retMsg);
	}
}
